package com.serge.smartdacha.model;

import java.util.Map;

public class PerimeterController extends Controller {

    private Boolean active;

    private Boolean alarm;

    public PerimeterController() {
        super("P");
    }

    @Override
    protected void init(Map<String, String> map) {
        setAlarm("1".equalsIgnoreCase(map.get("A")));
        setActive("1".equalsIgnoreCase(map.get("S")));
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    public Boolean getAlarm() {
        return alarm;
    }

    public void setAlarm(Boolean alarm) {
        this.alarm = alarm;
    }

    public String toSmsCommand(boolean checked) {
        return checked ? ON : OFF;
    }
}
